package com.itheima.map;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Demo02 {

    public static void main(String[] args) {

        Map<String ,Integer>   map= new HashMap<>();
        map.put("坤坤",26);
        map.put("签签",32);
        map.put("滔滔",28);
        map.put("小鹿",30);


        Set<String> keys = map.keySet();

     /*   Iterator<String> iterator = keys.iterator();
        while (iterator.hasNext()){
            String key = iterator.next();
            Integer value = map.get(key);
            System.out.println(key+"今年"+value);
        }*/
        /*for (String key : keys) {
            Integer value = map.get(key);
            System.out.println(key+"今年"+value);
        }*/
        keys.forEach(k-> System.out.println(k+"今年"+map.get(k)));


    }
}
